Array.prototype.distinct = function () {
    let temp = {}, len = this.length;
    for (let i = 0; i < len; i++) {
        let tmp = this[i];
        // eslint-disable-next-line no-prototype-builtins
        if (!temp.hasOwnProperty(tmp)) {//hasOwnProperty用来判断一个对象是否有你给出名称的属性或对象
            temp[this[i]] = "yes";
        }
    }
    len = 0;
    let tempArr = [];
    for (let i in temp) {
        tempArr[len++] = i;
    }
    return tempArr;
}

Array.prototype.remove = function (func){
    let index;
    for (let i = 0; i < this.length; i++) {
        if (func(this[i])) {
            index = i;
        }
    }
    if (index) {
        this.splice(index, 1);
    }
}
